<%@ page language="java" pageEncoding="UTF-8"%>
<%@ include file="/WEB-INF/jsp/common.jsp"%>
<html>
<head>
	<%-- <script src="${pageContext.request.contextPath}/resource/js/frm/sys/form.js"></script> --%>
	<style type="text/css">
		p,input,div,button{
			font-family: 微软雅黑;
		}
		button{
			margin-left: 356px;
			margin-top:10px;
		}
	
	</style>
</head>
<body>
<form id="subi" action="mutiForm" method="post" >
   <div>
        <p>No.1</p>
        名称：<input type="text" name="name[0]" value="小螃蟹" />
        作者：<input type="text" name="author[0]" value="大哥" />
    </div>
    <div style="margin-top: 20px;">
        <p>No.2</p>
        名称：<input type="text" name="name[1]" value="千纸鹤"/>
        作者：<input type="text" name="author[1]" value="小王子" />
    </div>
    <div style="margin-top: 20px;">
        <p>No.3</p>
        名称：<input type="text" name="name[2]" value="汤圆" />
        作者：<input type="text" name="author[2]" value="小凡"/>
    </div>
    <a class="btn btn-primary btn-sm" id="submit">提交</a>
</form>
<script>
$("#submit").click(function () { 
	var array = new Array();
		for(var i=0;i<10;i++){
			array.push({'id':i,
				'name':i+'name',
				'author':i,
				'status':'Y',
				'dispOrder':i});
		}
			$.ajax({
            url: 'mutiForm',
            type: 'POST',
            data:JSON.stringify($("#subi").serializeArray()),
            contentType: 'application/json',
            success: function (data) {
            	alert(data.length);
            },
            error: function (jqXHR, textStatus, errorThrown) {
                alert('An error has occured!! :-(');
            }
        });
				
});
    
</script>
</body>
</html>